// This example shows how to obtain all sources under the "Simulation" area. // // Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . using System; using System.Diagnostics; using OpcLabs.EasyOpc.AlarmsAndEvents; using OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace; using OpcLabs.EasyOpc.OperationModel; namespace DocExamples.AlarmsAndEvents._EasyAEClient { class BrowseSources { public static void Main1() { // Instantiate the client object. var client = new EasyAEClient(); AENodeElementCollection nodeElements; try { nodeElements = client.BrowseSources("", "OPCLabs.KitEventServer.2", "Simulation"); } catch (OpcException opcException) { Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message); return; } foreach (AENodeElement nodeElement in nodeElements) { Debug.Assert(nodeElement != null); Console.WriteLine("nodeElements[\"{0}\"]:", nodeElement.Name); Console.WriteLine(" .QualifiedName: {0}", nodeElement.QualifiedName); } } } }
# This example shows how to obtain all sources under the "Simulation" area. # # Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . # OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python . # The QuickOPC package is needed. Install it using "pip install opclabs_quickopc". import opclabs_quickopc # Import .NET namespaces. from OpcLabs.EasyOpc import * from OpcLabs.EasyOpc.AlarmsAndEvents import * from OpcLabs.EasyOpc.OperationModel import * # Instantiate the client object client = EasyAEClient() # Perform the operation try: nodeElements = IEasyAEClientExtension.BrowseSources(client, '', 'OPCLabs.KitEventServer.2', 'Simulation') except OpcException as opcException: print('*** Failure: ' + opcException.GetBaseException().Message) exit() # Display results for nodeElement in nodeElements: assert nodeElement is not None print('NodeElements["', nodeElement.Name, '"]:', sep='') print(' .QualifiedName: ', nodeElement.QualifiedName, sep='')
' This example shows how to obtain all sources under the "Simulation" area. ' ' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . Imports OpcLabs.EasyOpc.AlarmsAndEvents Imports OpcLabs.EasyOpc.AlarmsAndEvents.AddressSpace Imports OpcLabs.EasyOpc.OperationModel Namespace AlarmsAndEvents._EasyAEClient Friend Class BrowseSources Public Shared Sub Main1() Dim client = New EasyAEClient() Dim nodeElements As AENodeElementCollection Try nodeElements = client.BrowseSources("", "OPCLabs.KitEventServer.2", "Simulation") Catch opcException As OpcException Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message) Exit Sub End Try For Each nodeElement As AENodeElement In nodeElements Debug.Assert(nodeElement IsNot Nothing) Console.WriteLine("nodeElements[""{0}""]:", nodeElement.Name) Console.WriteLine(" .QualifiedName: {0}", nodeElement.QualifiedName) Next nodeElement End Sub End Class End Namespace
Rem This example shows how to obtain all sources under the "Simulation" area. Rem Rem Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html . Option Explicit Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.AlarmsAndEvents.EasyAEClient") On Error Resume Next Dim NodeElements: Set NodeElements = Client.BrowseSources("", "OPCLabs.KitEventServer.2", "Simulation") If Err.Number <> 0 Then WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description WScript.Quit End If On Error Goto 0 Dim NodeElement: For Each NodeElement In NodeElements WScript.Echo "NodeElements(""" & NodeElement.Name & """):" With NodeElement WScript.Echo Space(4) & ".QualifiedName: " & .QualifiedName End With Next
Copyright © 2004-2024 CODE Consulting and Development, s.r.o., Plzen. All rights reserved. Web page: www.opclabs.com
Send Documentation Feedback. Resources: Knowledge Base, Product Downloads. Technical support: Online Forums, FAQ.Missing some example? Ask us for it on our Online Forums! You do not have to own a commercial license in order to use Online Forums, and we reply to every post.